/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DiscountRule.java
 *
 * Created on Apr 25, 2011, 12:21:32 AM
 */

package shopaddmin;

/**
 *
 * @author TONGXIN SMYTH
 */
public class DiscountRule extends javax.swing.JPanel {

    /** Creates new form DiscountRule */
    public DiscountRule() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel6 = new javax.swing.JPanel();
        jScrollPane_discountRuleTable = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jButton_discountAdd = new javax.swing.JButton();
        jButton_discountSave = new javax.swing.JButton();
        jButton_discountSearch = new javax.swing.JButton();
        jLabel_discountRuleID = new javax.swing.JLabel();
        jLabel_dicountType = new javax.swing.JLabel();
        jLabel_discountPercent = new javax.swing.JLabel();
        jLabel_discountCount = new javax.swing.JLabel();
        jLabel_otherCount = new javax.swing.JLabel();
        jTextField_dicountRuleName = new javax.swing.JTextField();
        jComboBox_discountRuleType = new javax.swing.JComboBox();
        jTextField_discountPercentage = new javax.swing.JTextField();
        jTextField_discountCount = new javax.swing.JTextField();
        jTextField_discountOtherCount = new javax.swing.JTextField();

        setName("Form"); // NOI18N

        jPanel6.setName("jPanel6"); // NOI18N

        jScrollPane_discountRuleTable.setName("jScrollPane_discountRuleTable"); // NOI18N

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Rule ID", "Type", "Percentage", "Count", "Other Count"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Integer.class, java.lang.Double.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.setColumnSelectionAllowed(true);
        jTable1.setName("jTable1"); // NOI18N
        jScrollPane_discountRuleTable.setViewportView(jTable1);

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(shopaddmin.ShopAddminApp.class).getContext().getResourceMap(DiscountRule.class);
        jButton_discountAdd.setText(resourceMap.getString("jButton_discountAdd.text")); // NOI18N
        jButton_discountAdd.setName("jButton_discountAdd"); // NOI18N
        jButton_discountAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_discountAddActionPerformed(evt);
            }
        });

        jButton_discountSave.setText(resourceMap.getString("jButton_discountSave.text")); // NOI18N
        jButton_discountSave.setName("jButton_discountSave"); // NOI18N
        jButton_discountSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_discountSaveActionPerformed(evt);
            }
        });

        jButton_discountSearch.setText(resourceMap.getString("jButton_discountSearch.text")); // NOI18N
        jButton_discountSearch.setName("jButton_discountSearch"); // NOI18N
        jButton_discountSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_discountSearchActionPerformed(evt);
            }
        });

        jLabel_discountRuleID.setText(resourceMap.getString("jLabel_discountRuleID.text")); // NOI18N
        jLabel_discountRuleID.setName("jLabel_discountRuleID"); // NOI18N

        jLabel_dicountType.setText(resourceMap.getString("jLabel_dicountType.text")); // NOI18N
        jLabel_dicountType.setName("jLabel_dicountType"); // NOI18N

        jLabel_discountPercent.setText(resourceMap.getString("jLabel_discountPercent.text")); // NOI18N
        jLabel_discountPercent.setName("jLabel_discountPercent"); // NOI18N

        jLabel_discountCount.setText(resourceMap.getString("jLabel_discountCount.text")); // NOI18N
        jLabel_discountCount.setName("jLabel_discountCount"); // NOI18N

        jLabel_otherCount.setText(resourceMap.getString("jLabel_otherCount.text")); // NOI18N
        jLabel_otherCount.setName("jLabel_otherCount"); // NOI18N

        jTextField_dicountRuleName.setText(resourceMap.getString("jTextField_dicountRuleName.text")); // NOI18N
        jTextField_dicountRuleName.setName("jTextField_dicountRuleName"); // NOI18N

        jComboBox_discountRuleType.setEditable(true);
        jComboBox_discountRuleType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2" }));
        jComboBox_discountRuleType.setName("jComboBox_discountRuleType"); // NOI18N

        jTextField_discountPercentage.setText(resourceMap.getString("jTextField_discountPercentage.text")); // NOI18N
        jTextField_discountPercentage.setName("jTextField_discountPercentage"); // NOI18N

        jTextField_discountCount.setText(resourceMap.getString("jTextField_discountCount.text")); // NOI18N
        jTextField_discountCount.setName("jTextField_discountCount"); // NOI18N

        jTextField_discountOtherCount.setText(resourceMap.getString("jTextField_discountOtherCount.text")); // NOI18N
        jTextField_discountOtherCount.setName("jTextField_discountOtherCount"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane_discountRuleTable, javax.swing.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                        .addComponent(jButton_discountSearch)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton_discountAdd)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton_discountSave))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel_discountRuleID)
                            .addComponent(jLabel_dicountType)
                            .addComponent(jLabel_discountPercent)
                            .addComponent(jLabel_discountCount)
                            .addComponent(jLabel_otherCount))
                        .addGap(25, 25, 25)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField_dicountRuleName, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
                            .addComponent(jComboBox_discountRuleType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jTextField_discountPercentage)
                            .addComponent(jTextField_discountCount)
                            .addComponent(jTextField_discountOtherCount))))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane_discountRuleTable, javax.swing.GroupLayout.PREFERRED_SIZE, 302, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_discountRuleID)
                    .addComponent(jTextField_dicountRuleName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_dicountType)
                    .addComponent(jComboBox_discountRuleType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_discountPercent)
                    .addComponent(jTextField_discountPercentage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_discountCount)
                    .addComponent(jTextField_discountCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel_otherCount)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 66, Short.MAX_VALUE)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton_discountAdd)
                            .addComponent(jButton_discountSave)
                            .addComponent(jButton_discountSearch)))
                    .addComponent(jTextField_discountOtherCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 763, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 613, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_discountSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_discountSearchActionPerformed

    }//GEN-LAST:event_jButton_discountSearchActionPerformed

    private void jButton_discountAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_discountAddActionPerformed

    }//GEN-LAST:event_jButton_discountAddActionPerformed

    private void jButton_discountSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_discountSaveActionPerformed
        
    }//GEN-LAST:event_jButton_discountSaveActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_discountAdd;
    private javax.swing.JButton jButton_discountSave;
    private javax.swing.JButton jButton_discountSearch;
    private javax.swing.JComboBox jComboBox_discountRuleType;
    private javax.swing.JLabel jLabel_dicountType;
    private javax.swing.JLabel jLabel_discountCount;
    private javax.swing.JLabel jLabel_discountPercent;
    private javax.swing.JLabel jLabel_discountRuleID;
    private javax.swing.JLabel jLabel_otherCount;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane_discountRuleTable;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField_dicountRuleName;
    private javax.swing.JTextField jTextField_discountCount;
    private javax.swing.JTextField jTextField_discountOtherCount;
    private javax.swing.JTextField jTextField_discountPercentage;
    // End of variables declaration//GEN-END:variables

}
